package com.sl.water.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sl.water.dao.PlanEWzDao;
import com.sl.water.entity.PlanEWz;
import com.sl.water.service.PlanEWzService;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * @description:
 * @author: duan
 * @time: 2025-06-30 14:23
 */
@Service
@RequiredArgsConstructor
public class PlanEWzServiceImpl extends ServiceImpl<PlanEWzDao, PlanEWz> implements PlanEWzService {
    @Override
    public Page<PlanEWz> pageList(int page, int size, String wzk) {
        if (StringUtils.isNotEmpty(wzk)) {
            LambdaQueryWrapper<PlanEWz> lambdaQueryWrapper = new LambdaQueryWrapper<>();
            lambdaQueryWrapper.eq(PlanEWz::getWzk, wzk);
            return this.page(new Page<>(page, size), lambdaQueryWrapper);
        }
        return this.page(new Page<>(page, size));
    }
}
